#ifndef _TX_ANIMATION_
#define _TX_ANIMATION_

#include "Iw2D.h"
#include "TxDrawingElement.h"
#include <map>

class TxSimpleAnimation : public TxDrawingElement
{
	int												currentFrameNumber;
	int												framesTotalNumber;
	float											frameRate;
	int64											lastFrameTime;
	bool											isRunning;
	bool											isLooped;
	bool											isReversed;
	std::map<int, std::pair<CIwFVec2, CIwFVec2> >	frames;
	std::map<int, CIwFVec2>							delta;
	virtual void									initialize();
	void											parseXML(char* xmlName);
	void											setNextFrame();
public:
	virtual ~TxSimpleAnimation();
	static TxSimpleAnimation*						createSimpleAnimation(char* file, float rate);
	virtual void									drawElement();
};

#endif